package edu.toronto.whimper.GraphsObjects;

import android.content.Context;
import android.widget.Toast;

import com.androidplot.series.XYSeries;

public class SampleDynamicSeries implements XYSeries {
    private NoiseDataSource datasource;
    private int seriesIndex;
    private String title;
    private Context context;
    public SampleDynamicSeries(NoiseDataSource datasource, int seriesIndex, String title,Context context) {
        this.datasource = datasource;
        this.seriesIndex = seriesIndex;
        this.title = title;
        this.context = context;
        
    }
    
    public void setDataSource(NoiseDataSource datasource){
    	this.datasource = datasource;
    }
    
    public String getTitle() {
        return title;
    }

    public int size() {
        return datasource.getItemCount(seriesIndex);
    }

    public Number getX(int index) {
    	//Toast.makeText( context, "index: " + index, Toast.LENGTH_SHORT).show();
        return datasource.getX(seriesIndex, index);
    }

    public Number getY(int index) {
        return datasource.getY(seriesIndex, index);
    }
}
